package com.hbnu.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hbnu.system.core.base.CommonPage;
import com.hbnu.system.model.dto.CheckBackDTO;
import com.hbnu.system.model.entity.Achievement;
import com.hbnu.system.model.query.AchievementPageQuery;
import com.hbnu.system.model.vo.AchievementVO;
import org.springframework.web.bind.annotation.RequestBody;

import java.io.IOException;

/**
 * 科研成果表(Achievement)表服务接口
 *
 * @author makejava
 * @since 2025-07-21 15:59:42
 */
public interface AchievementService extends IService<Achievement> {

    /**
     * 新增专利 正式
     *
     * @param achievement
     * @return 是否成功
     */
    boolean addAchievement(@RequestBody Achievement achievement);

    /**
     * 删除专利
     *
     */
    boolean deleteAchievement(String achievementID) throws IOException;

    /**
     * 根据专利DTO主键查询专利
     *
     * @param achievementID
     * @return Paper
     */
//    AchievementDTO getAchievementDTOById(String achievementID);

    /**
     * 根据专利主键查询专利
     *
     * @param achievementID
     * @return Paper
     */
    Achievement getAchievementById(String achievementID);


    /**
     * 修改专利
     *
     * @param achievement
     * @return 是否成功
     */
    boolean updateAchievement(Achievement achievement);

    /**
     * 专利名称查重
     * @param achievement_name
     * @return 是否重复
     */
    boolean checkAchievementName(String achievement_name);

    /**
     * 院级审核通过
     */
    Boolean collegeCheckPass(String token,String PaID);

    /**
     * 院级审核打回
     */
    Boolean collegeCheckBack(String token, CheckBackDTO checkBackDTO);

    /**
     * 校级审核通过
     */
    Boolean schoolCheckPass(String token,String PaID);

    /**
     * 校级审核打回
     */
    Boolean schoolCheckBack(String token,CheckBackDTO checkBackDTO);

    /**
     * 专利再度提交
     */
    Boolean ReCommitAchievement(String achievementID);
    
    /**
     * 撤回科研成果
     */
    Boolean withdrawAchievement(String token, String achievementID);


    /**
     * 普通用户分页查看与自己相关的专利
     */
    CommonPage<AchievementVO> userGetRelateAchievement(AchievementPageQuery achievementPageQuery);

    CommonPage<Achievement> export(AchievementPageQuery achievementPageQuery);

}

